﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using gnu.trove.map.hash;

namespace Game.templates.jump
{
    public class JumpWay
    {
	    /**
	     * Field _id.
	     */
	    private int _id;
	    /**
	     * Field _points.
	     */
	    private TIntObjectHashMap _points;
	
	    /**
	     * Constructor for JumpWay.
	     * @param id int
	     */
	    public JumpWay(int id)
	    {
		    _id = id;
		    _points = new TIntObjectHashMap();
	    }
	
	    /**
	     * Method getId.
	     * @return int
	     */
	    public int getId()
	    {
		    return _id;
	    }
	
	    /**
	     * Method getPoints.
	     * @return JumpPoint[]
	     */
	    public JumpPoint[] getPoints()
	    {
		    return _points.values(new JumpPoint[_points.size()]);
	    }
	
	    /**
	     * Method getJumpPoint.
	     * @param nextWayId int
	     * @return JumpPoint
	     */
	    public JumpPoint getJumpPoint(int nextWayId)
	    {
		    return _points.get(nextWayId);
	    }
	
	    /**
	     * Method addPoint.
	     * @param point JumpPoint
	     */
	    public void addPoint(JumpPoint point)
	    {
		    _points.put(point.getNextWayId(), point);
	    }
    }

}
